The Tab View Component > FTabView.setDataProvider() |
FTabView.setDataProvider()
Availability
Flash Player 6.
Usage
myTab_tbv.setDataProvider (dataProvider)
Parameters
dataProvider A DataProvider that will be used to define and
create tabs within the component.
Returns
Nothing
Description
This specifies the DataProvider that should be used to create and populate tabs within the component. The DataProvider should have the following fields,
label |
The name of the tab. |
data |
If specified, contains an Object associated with the tab. |
Notes
The name of the property that contains the name of the tab can be changed using the setLabelField method. The default value is "label".
Example
The tab_addListener.fla example file contains an example of using this method.
The following code retrieves the Data Provider from the component and traces the label of the second tab.
var dp = new Array();
dp.push({label: "Tab1"});
dp.push({label: "Tab2"});
dp.push({label: "Tab3"});
myTab_tbv.setDataProvider( dp );
dp = myTab_tbv.getDataProvider( );
trace( "Tab 2: " + dp.getItemAt(1).label ); //trace "Tab 2: Tab2"
See also